package com.codes;

import com.tim.controller.BaseContoller;
import com.utils.ApiSql;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.bind.annotation.RestController;

@ImportResource(value = {
        "classpath*:spring-bean.xml"
})
@RestController
@SpringBootApplication
@Api(value = "响应自定义", tags = "响应自定义")
@EnableAsync
public class TimeDbDemoApplication extends BaseContoller {
    @Autowired
    ApiSql apiSql;

    public static void main(String[] args) {
        SpringApplication.run(TimeDbDemoApplication.class, args);
    }
    @Bean
    public void init(){
//        List<Map<String, Object>> maps = apiSql.runSqlByParam(new HashMap<>(), "test", "test1");
//        Map<String, Object> stringObjectMap = apiSql.runSqlByParamItem(new HashMap<>(), "test", "test1");
//        System.out.println(maps.size());
//        System.out.println(stringObjectMap);

        apiSql.init();
//        InitTestDataBean initTestDataBean = new InitTestDataBean();
////        initTestDataBean.setTableName("t_js_user_1");
//        initTestDataBean.setTableName("t_js_user_3");
//        System.out.println("---s");
//        apiSql.initTaleTestData(initTestDataBean);
    }
}
